<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Person{
            constructor(name,age){//他们都有共同的属性‘人’，这样写可节约内存，反之为constructor(name,age，species)
                this.name=name;
                this.age=age;
            }
        }
        Person.prototype.species = function(){
            console.log('人')
        }
        //person.prototype.species()
        //Person.prototype.species='人'
        let person1=new Person('kim',10)
        let person2=new Person('jake',30)
        //person1.species()
        
        console.log(person1.species)
        console.log(person1.__proto__)
        console.log(Person.prototype)
    </script>
</body>
</html>